﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SimpleData.ObjectModel;
using SimpleData.Data;
using SimpleData.Infrastructure;

namespace SimpleData.Data
{

	/// <summary>
	/// 
	/// </summary>
	internal static class DatabaseScopeExtensions
	{
		public static void Add<TEntity>( this IDatabaseScope<IRepository> scope, TEntity entity )
			where TEntity : class
		{
			scope.Repository.Add( entity );
		}

		public static TEntity Create<TEntity>( this IDatabaseScope<IRepository> scope )
			where TEntity : class
		{
			return scope.Repository.Create<TEntity>();
		}
	}
}
